package io.renren.modules.sys.service.impl;

import io.renren.modules.sys.entity.ProductEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.sys.dao.ReplenishmentitemDao;
import io.renren.modules.sys.entity.ReplenishmentitemEntity;
import io.renren.modules.sys.service.ReplenishmentitemService;


@Service("replenishmentitemService")
public class ReplenishmentitemServiceImpl extends ServiceImpl<ReplenishmentitemDao, ReplenishmentitemEntity> implements ReplenishmentitemService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ReplenishmentitemEntity> page = this.page(
                new Query<ReplenishmentitemEntity>().getPage(params),
                new QueryWrapper<ReplenishmentitemEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ProductEntity> getByReplenishId(Integer replenishId){
        List<ProductEntity> list = baseMapper.getByReplenishId(replenishId);
        return list;
    }
}
